<?php

class Logger {
	const LevelDebug   = 1;
	const LevelInfo    = 2;
	const LevelError   = 3;
	const LevelDisplay = 4;

	private $_logLevel = 1;

	public function setLogLevel($logLevel)
	{
		$this->_logLevel = $logLevel;
	}

	public function display($message, $newline=true)
	{
		print $message;
		if ($newline) {
			print "\n";
		}
		$this->event(self::LevelDisplay, $message);
	}

	public function event($logLevel, $action, $message=null)
	{
		if ($logLevel >= $this->_logLevel &&
			$logLevel != self::LevelDisplay) {
			print "{$logLevel}: {$action}\t{$message}\n";
		}
		//@todo put all logs to disk
	}
}
